{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"visible\", \"mobile\"];\nimport * as React from 'react';\nimport { useState, useEffect } from 'react';\nimport isMobile from \"rc-util/es/isMobile\";\nimport Mask from \"./Mask\";\nimport PopupInner from \"./PopupInner\";\nimport MobilePopupInner from \"./MobilePopupInner\";\nvar Popup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n  var visible = _ref.visible,\n    mobile = _ref.mobile,\n    props = _objectWithoutProperties(_ref, _excluded);\n  var _useState = useState(visible),\n    _useState2 = _slicedToArray(_useState, 2),\n    innerVisible = _useState2[0],\n    serInnerVisible = _useState2[1];\n  var _useState3 = useState(false),\n    _useState4 = _slicedToArray(_useState3, 2),\n    inMobile = _useState4[0],\n    setInMobile = _useState4[1];\n  var cloneProps = _objectSpread(_objectSpread({}, props), {}, {\n    visible: innerVisible\n  }); // We check mobile in visible changed here.\n  // And this also delay set `innerVisible` to avoid popup component render flash\n\n  useEffect(function () {\n    serInnerVisible(visible);\n    if (visible && mobile) {\n      setInMobile(isMobile());\n    }\n  }, [visible, mobile]);\n  var popupNode = inMobile ? /*#__PURE__*/React.createElement(MobilePopupInner, _extends({}, cloneProps, {\n    mobile: mobile,\n    ref: ref\n  })) : /*#__PURE__*/React.createElement(PopupInner, _extends({}, cloneProps, {\n    ref: ref\n  })); // We can use fragment directly but this may failed some selector usage. Keep as origin logic\n\n  return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Mask, cloneProps), popupNode);\n});\nPopup.displayName = 'Popup';\nexport default Popup;","map":{"version":3,"names":["_extends","_objectSpread","_slicedToArray","_objectWithoutProperties","_excluded","React","useState","useEffect","isMobile","Mask","PopupInner","MobilePopupInner","Popup","forwardRef","_ref","ref","visible","mobile","props","_useState","_useState2","innerVisible","serInnerVisible","_useState3","_useState4","inMobile","setInMobile","cloneProps","popupNode","createElement","displayName"],"sources":["/data/messenger.client/node_modules/rc-trigger/es/Popup/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"visible\", \"mobile\"];\nimport * as React from 'react';\nimport { useState, useEffect } from 'react';\nimport isMobile from \"rc-util/es/isMobile\";\nimport Mask from \"./Mask\";\nimport PopupInner from \"./PopupInner\";\nimport MobilePopupInner from \"./MobilePopupInner\";\nvar Popup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n  var visible = _ref.visible,\n      mobile = _ref.mobile,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  var _useState = useState(visible),\n      _useState2 = _slicedToArray(_useState, 2),\n      innerVisible = _useState2[0],\n      serInnerVisible = _useState2[1];\n\n  var _useState3 = useState(false),\n      _useState4 = _slicedToArray(_useState3, 2),\n      inMobile = _useState4[0],\n      setInMobile = _useState4[1];\n\n  var cloneProps = _objectSpread(_objectSpread({}, props), {}, {\n    visible: innerVisible\n  }); // We check mobile in visible changed here.\n  // And this also delay set `innerVisible` to avoid popup component render flash\n\n\n  useEffect(function () {\n    serInnerVisible(visible);\n\n    if (visible && mobile) {\n      setInMobile(isMobile());\n    }\n  }, [visible, mobile]);\n  var popupNode = inMobile ? /*#__PURE__*/React.createElement(MobilePopupInner, _extends({}, cloneProps, {\n    mobile: mobile,\n    ref: ref\n  })) : /*#__PURE__*/React.createElement(PopupInner, _extends({}, cloneProps, {\n    ref: ref\n  })); // We can use fragment directly but this may failed some selector usage. Keep as origin logic\n\n  return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Mask, cloneProps), popupNode);\n});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